#include "PositionTest.h"
#include "Position.h"
#include "Timeout.h"

CPPUNIT_TEST_SUITE_REGISTRATION(PositionTest);

void PositionTest::setUp() {
	START_TIMEOUT(1000);
}

void PositionTest::tearDown() {
	STOP_TIMEOUT();
}

void PositionTest::testCreateCenterPosition() {
	CPPUNIT_ASSERT(Position(3, 3) == Position::center(7, 7));
}

void PositionTest::testCreateLeftPosition() {
	CPPUNIT_ASSERT(Position(1, 2) == Position(2, 2).left());
}

void PositionTest::testCreateUpPosition() {
	CPPUNIT_ASSERT(Position(2, 1) == Position(2, 2).up());
}

void PositionTest::testCreateRightPosition() {
	CPPUNIT_ASSERT(Position(3, 2) == Position(2, 2).right());
}

void PositionTest::testCreateDownPosition() {
	CPPUNIT_ASSERT(Position(2, 3) == Position(2, 2).down());
}

